Split String
A very useful text manipulation algorithm is the Split String option. This process divides a string into an array of strings.
If your data is stored as a string with a common separator between each individual value, you can use this option to select specific strings of data from an existing string, and send them to a target column. You need to define the data source, the separator, and where you want the result to be stored (destination column). This option also lets you skip strings and select data placed at a designated location by setting how many times the separator appears before copying the remaining string to the target field.
For example, if the source data is a string consisting of a first name, last name, id number (e.g. Nir,Sidi,1), and the string you are interested in is the id number, then you can define the separator as a comma (,) and the index as 2, so that the system will copy only the string located after the second comma appears in the source data.
The result will be as follows:
Source Column | Target Column |
---|---|
Nir,Sidi,1 | 1 |
Joe,Walsh,23 | 23 |
To configure this manipulate step, follow the instructions below:
- In the Admin Navigation tree, select Interfaces > InterfaceName > Tasks > TaskName > Steps.
- On the toolbar, click New >New Manipulate Step.
Creating a New Manipulate Step
- Navigate to the Texts section and select Split String.
Texts Section
- In the Split String work area, fill in the following fields
Fields | Description |
---|---|
Name |
Provide a distinctive name for this step. |
Is Active |
Select the check box to engage the scheduler for this step. |
Order of Execution |
Enter the order in which this step should be executed. |
Filter Expression |
Optional. Use this filed to filter data from the source database prior to inserting it into the Schema table. |
Sort Expression |
Optional. Use this field to sort data from the source database prior to inserting it into the Schema table. |
Stop interface execution if query failed |
Optional. If enabled, the system will stop any data manipulation if the query returns an error. |
Save Schema (enabled per interface) |
If selected, the schema is created for this step. |
Source Column | Select the column where you will retrieve the data source. |
Target Column | Select the column where the result will be stored. |
Split Value | Define the separator that is used in the source string. |
Array Index to Use | Define the index so the system will copy only the sting located after the specified separator. |
- Click the Save button.